﻿using System;
using System.Web.UI;
using mojoPortal.Web.RS.AppCode.Lib;

namespace mojoPortal.Web.RS.Secure
{
    public partial class RSAfterSignInHandler : mojoBasePage
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                mojoPortal.Business.SiteUser siteUser = mojoPortal.Web.SiteUtils.GetCurrentSiteUser();
                if (siteUser != null && siteUser.MobilePin.Length > 0)
                {
                    string rsModule = "";
                    string rsLandingPageURL = "";
                    if (RSCommonFunctions.ValidateReadyServiceUserPIN2(ref rsModule, ref rsLandingPageURL))
                    {
                        Response.Redirect(rsLandingPageURL);
                    }
                }
                Response.Redirect("~/");
            }
        }
    }
}